﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Windows;

namespace FunCam
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public App()
        {
            this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);
        }

        void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            MessageBox.Show(
                "Oh dear.  Something went horribly wrong.  Could you please report the below message to the author?  Thanks!\n\n"
                + "Project website: funcam.codeplex.com\n"
                + "Error: " + e.Exception.Message, "There was an error");

            Process.Start("http://funcam.codeplex.com/workitem/list/basic");
        }
    }
}
